#pragma once
#include <string>
#include <fstream>
#include <mutex>

enum class LogLevel {
    ERROR,
    WARNING,
    INFO,
    NOTIFY
};

class Logger {
public:
    static Logger& getInstance();

    void setLogFile(const std::string& filename);

    void log(LogLevel level, const std::string& message);

    void error(const std::string& message);
    void warning(const std::string& message);
    void info(const std::string& message);
    void notify(const std::string& message);

private:
    Logger();
    ~Logger();
    Logger(const Logger&) = delete;
    Logger& operator=(const Logger&) = delete;

    std::ofstream logfile_;
    std::mutex mutex_;

    std::string getPrefix(LogLevel level);
    std::string getCurrentTime();
};